package com.tjsinfo.tjsoa.bylaws.action;

import java.util.List;
import java.util.ResourceBundle;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;

import org.apache.struts.action.Action;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;

import com.tjsinfo.tjsoa.bylaws.bo.IBylawsBO;
import com.tjsinfo.tjsoa.bylaws.dao.IBylawsDao;
import com.tjsinfo.tjsoa.bylaws.vo.Bylaws;
import com.tjsinfo.tjsoa.system.vo.User;
import com.tjsinfo.tjsoa.workplan.bo.IWorkPlanMainBo;

public class AuditAction extends Action{
	
	private IBylawsBO bylawsManager;

	public void setBylawsManager(IBylawsBO bylawsManager) {
		this.bylawsManager = bylawsManager;
	}
	private IWorkPlanMainBo workPlanMainBo;
	public IWorkPlanMainBo getWorkPlanMainBo() {
		return workPlanMainBo;
	}

	public void setWorkPlanMainBo(IWorkPlanMainBo workPlanMainBo) {
		this.workPlanMainBo = workPlanMainBo;
	}
	public ActionForward execute(ActionMapping mapping,ActionForm form,
			HttpServletRequest request,HttpServletResponse response){		
		
		try{

			HttpSession session=request.getSession();
			User user = (User)session.getAttribute("user");
						
			
			String id=request.getParameter("id");
			List bylaws=null;
			bylaws=bylawsManager.findByProperty("id", id);
			request.setAttribute("bylaws", bylaws);


			workPlanMainBo.selectMapWorkPlanMain(request);				
			return mapping.findForward("toaudit");
			
		}catch(Exception e){
			e.printStackTrace();
			return mapping.findForward("failed");
		}
	}

}
